﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompanyBussiness
{
    interface INewsManagement
    {
        List<Category> GetParentCategory(int languagesID, Boolean categoryStatus, string modulCode);
        List<Category> GetParentCategoryAll(int languagesID, string modulCode);
        List<Category> GetChildrenCategoryAll(int languagesID, Boolean categoryStatus, string modulCode);
        List<Category> GetChildrenCategoryByParentID(int parentCategoryID, int languagesID, Boolean categoryStatus, string modulCode);
        List<Category> GetChildrenCategoryByParentIDAll(int parentCategoryID, int languagesID, string modulCode);
        Category GetCategoryByID(int categoryID, string modulCode);
        Category GetCategoryByNameSingle(string categoryName, string modulCode);
        Category GetCategoryByParentCategoryID(int categoryID, string modulCode);
        List<Category> GetCategoryByName(string categoryName, int languagesID, Boolean categoryStatus, string modulCode);
        List<Category> GetCategoryByStatus(int languagesID, Boolean categoryStatus, string modulCode);
        int GetTopParentCategoryID(int languagesID, string modulCode);          //Lay mac dinh ra parent category dau tien xep tu be den lon theo ID

        List<New> GetNewsByCategoryStatus(int categoryID, Boolean newsStatus, int take, int StartRow, string modulcode);
        int GetNewsByCategoryStatusPageCount(int categoryID, Boolean newsStatus, int take, int StartRow, string modulcode);
        List<New> GetNewsByParentCategory(int categoryID, int take, int StartRow);
        List<New> GetNewsByCategory(int categoryID, int take, int StartRow);
        List<New> GetNewsSearch(New news,DateTime DateForm,DateTime DateTo, int take, int StartRow);
        List<New> GetNewsSearchNotDate(New news, int take, int StartRow);
        int GetNumberNewsSearchNotDate(New news);
        int GetNumberNewsByCategory(int categoryID);
        int GetNumberNewsSearch(New news, DateTime DateForm, DateTime DateTo);
        List<New> GetNewsByCategoryIDAll(int categoryID);
        New GetNewsByID(int newsID);
        List<New> GetNewsByTitle(string newsSubject, int take, int StartRow);
        List<New> GetNewsByDate(int languagesID, DateTime newsDate, int take, int StartRow);
        List<New> GetNewsByStatus(int languagesID, Boolean newsStatus, int take, int StartRow);
        Array GetListNewsRandom(int categoryID, Boolean newsStatus);

        int CreateCategory(int parentCategoryID, string categoryName, string categoryIntro, string categoryDes, string categoryImg, Boolean categoryStatus, Boolean imagesStatus, int languagesID, string modulCode);
        void UpdateCategory(int categoryID, int parentCategoryID, string categoryName, string categoryIntro, string categoryDes, string categoryImg, Boolean categoryStatus, Boolean imagesStatus, int languagesID, string modulCode);
        void DeleteCategory(int categoryID);

        int CreateNews(string newsSubject, string newsIntro, string newsContent, string newsAuthor, string newsSource, string newsLink, DateTime newsDateCreate, int newsAccess, string newsImage, Boolean newsStatus, string fileAttach, Boolean imagesStatus, int categoryID);
        void UpdateNews(int newsID, string newsSubject, string newsIntro, string newsContent, string newsAuthor, string newsSource, string newsLink, DateTime newsDate, int newsAccess, string newsImage, Boolean newsStatus, string fileAttach, Boolean imagesStatus, int categoryID);
        void DeleteNews(int newsID);

        Metadata GetMetadataByNewsID(int newsID);
        Metadata GetMetadataByProductID(int productID);
        Metadata GetMetadataByCategoryID(int categoryID);
        Metadata GetMetadataByTypeProductID(int typeProductID);

        void CreateMetadata(Metadata metadata);
        void UpdateMetadata(Metadata metadata);
        void DeletaMetadata(int metaID);

        Modul GetModulByModulCode(string modulCode);

        New GetNewsOneByCategoryName(string categoryName, int languagesID);
        List<New> GetListNewsSearch(string newSubject, int take, int StartRow);

        string GetNameCateByID(int id);
        string GetNameNewsByID(int id);
    }
}
